apiready = function() {
    seajs.use(['../../V', "../../api", "../../jquery", "../../app", "../../service", "../../pop"], function(V, $api, $, $app, service, $pop) {
      $app.ready();
        var vm = {
            el: '.container',
            data: {
                money: '',
                name: ''
            },
            methods: {
                //--查看订单
                openMyOrder: function(et) {
                    $app.openWin('buyOrderMy', {
                        index: 2
                    });
                },
                //--个人中心
                openMyperson: function(et) {
                    //$app.openWin('buyPerson');
                    // 完成一个任务触发首页跳转到中间
                    api.sendEvent({
                        name: 'login_flag'
                    });
                    api.sendEvent({
                        name: 'toStar'
                    });
                    api.sendEvent({
                        name: 'getStar'
                    });
                    api.sendEvent({
                        name: 'getUserInfo'
                    });
                    api.sendEvent({
                        name: 'goods_detail_back'
                    });
                    api.openWin({
                        name: 'index',
                        url: 'widget://src/Shop/shop_index/shop_index.html',
                        pageParam: {},
                        slidBackEnabled: false
                    })
                }
            },
            mounted: function() {
                var self = this;

                function btnKeyBack() {
                    api.sendEvent({
                        name: 'orderInit_',
                    });
                    $api.setTimeout(function() {
                        api.closeToWin({
                            name: 'shopIndex__'
                        });
                    }, 300);
                }
                //--点击上面按钮返回
                $api.addEvt($api.dom('#btn-back-new'), 'click', function() {
                    btnKeyBack();
                });

                //--返回键
                api.addEventListener({
                    name: 'keyback'
                }, function(ret, err) {
                    btnKeyBack();
                });
                //--右滑
                api.addEventListener({
                    name: 'swiperight'
                }, function(ret, err) {
                    btnKeyBack();
                });
            },
            created: function() {
                this.money = (+api.pageParam.money).toFixed(2);
                this.name = api.pageParam.name || api.pageParam.prve;
            }
        };
        //var shopVue = new Vue(vm);
        var even = function() {

        };
        var newVue = new Vue(vm);
        even();

    })
}
